package com.ss.android.article.base.feature.detail2.widget.a;

import android.content.Context;
import android.widget.TextView;

import com.bytedance.common.utility.UIUtils;
import com.ss.android.article.browser.R;
import com.ss.android.article.common.NightModeAsyncImageView;

public final class DetailAdBannerLayout extends BaseDetailLayout {
    private NightModeAsyncImageView adBannerImageIv;
    private TextView detailAdBannerTitleTv;
    private TextView detailAdBannerDescTv;
    private TextView adBannerLabelTv;

    public DetailAdBannerLayout(Context arg1) {
        super(arg1);
    }

    public final void a(String arg4, int arg5, int arg6) {
        this.adBannerImageIv.setUrl(arg4);
        this.adBannerImageIv.setAspectRatio((((float) arg5)) / (((float) arg6)));
    }

    public final void adaptNightMode(boolean arg4) {
        super.adaptNightMode(arg4);
        UIUtils.setBackgroundResource(this.adBannerImageIv, R.drawable.detail_ad_banner_bg);
        this.detailAdBannerTitleTv.setTextColor(this.getResources().getColorStateList(com.ss.android.article.browser.R.color.detail_ad_banner_title));
        this.detailAdBannerDescTv.setTextColor(this.getResources().getColorStateList(com.ss.android.article.browser.R.color.detail_ad_banner_desc));
        this.adBannerImageIv.adaptNightMode(arg4);
    }

    public final void initView() {
        super.initView();
        this.adBannerImageIv = this.findViewById(com.ss.android.article.browser.R.id.ad_banner_image);
        this.detailAdBannerTitleTv = this.findViewById(com.ss.android.article.browser.R.id.detail_ad_banner_title);
        this.detailAdBannerDescTv = this.findViewById(com.ss.android.article.browser.R.id.detail_ad_banner_desc);
        this.adBannerLabelTv = this.findViewById(com.ss.android.article.browser.R.id.ad_banner_label);
    }

    public final int getLayoutRes() {
        return R.layout.new_ad_banner_layout;
    }

    public final void setDescText(String arg2) {
        this.detailAdBannerDescTv.setText(((CharSequence) arg2));
    }

    public final void setLabelText(String arg2) {
        this.adBannerLabelTv.setText(((CharSequence) arg2));
    }

    public final void setTitleText(String arg2) {
        this.detailAdBannerTitleTv.setText(((CharSequence) arg2));
    }
}

